#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdio.h>
int main() {
    long long a, b;
    scanf("%lld %lld", &a, &b);
    long long l = a > b ? a : b;
    long long  s = a > b ? b : a;
    while (l % s) {
        long long  tmp = s;
        s = l % s;
        l = tmp;
    }
    printf("%lld", s + (a * b) / s);

}